package com.zixun.repository;

import com.zixun.model.Offer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by Basil on 16/8/13.
 */
public interface OfferRepository extends JpaRepository<Offer,Integer> {

    @Query("select offer from Offer offer where offer.produceId = :id and offer.type = :typeId")
    List<Offer> findByProduceIdAndType(@Param("id")Integer requestId,@Param("typeId")Integer type);
}
